package com.ruoyi.model.service;

import org.springframework.integration.annotation.MessagingGateway;
import org.springframework.integration.mqtt.support.MqttHeaders;
import org.springframework.messaging.handler.annotation.Header;

/**
 * @author lxj
 * @date 2022-04-01 10:31
 * @description: 接口.
 */
@MessagingGateway(defaultRequestChannel = "mqttOutboundChannel")
public interface MqttGateway {
    /**
     * 发送消息
     * @param data
     * @param topic
     */
    void sendToMqtt(String data, @Header(MqttHeaders.TOPIC) String topic);
}